local iori_jump = class('iori_jump',function()
	return display.newNode()
end)

function iori_jump:ctor()

	--self:setRotation(90)
	self:pos(0,-50)
	--self:setAnchorPoint(cc.p(0,0))
	--local ap = self:getAnchorPoint()
	--print(string.format('jump AnchorPoint: x=%g,y=%g',ap.x,ap.y))
	--local iori = display.newSprite('#iori2_054.png'):addTo(self)
	--iori:setOffsetPosition(cc.p(iori:getContentSize().width/2,iori:getContentSize().height/2))
	--iori:pos(-iori:getContentSize().width/2,-iori:getContentSize().height/2)
	--ap = iori:getAnchorPoint()
	--print(string.format('iori AnchorPoint: x=%g,y=%g',ap.x,ap.y))
	--local dot = display.newSolidCircle(8,{color = cc.c4f(0.0,1,0,0.8)}):addTo(self)

	local frames = display.newFrames("iori2_%03d.png", 54, 14)

	--animation = display.newAnimation(frames,0.8/#frames)
	--iori:playAnimationForever(animation)
	--local physicsNode = display.newNode():addTo(iori)
	--physicsNode:pos(0,0)
	--local wp = physicsNode:convertToWorldSpace(cc.p(0,0))
	--print(wp.x,wp.y)
	--wp = iori:convertToWorldSpace(cc.p(0,0))
	--printf('iori to world pos : x=%g,y=%g',wp.x,wp.y)
	--dot = display.newSolidCircle(8,{color = cc.c4f(0.0,0,1.0,0.8)}):addTo(physicsNode)
	--dot:pos(0,0)
	--local physicsBoxSize = cc.size(88,64)
	--local physicsBody = cc.PhysicsBody:createBox(physicsBoxSize)
	--physicsNode:setPhysicsBody(physicsBody)
	--physicsNode:setTag(110)

	--local physicsNodeX = iori:getContentSize().width - physicsBoxSize.width/2
	--local physicsNodeY = iori:getContentSize().height - physicsBoxSize.height/2
	--physicsNode:pos(physicsNodeX-28,physicsNodeY-4)
	--local rect = iori:getBoundingBox()
	--display.newRect(rect,{fillColor = cc.c4f(1,0,0,0.2), borderColor = cc.c4f(0,1,0,0.6), borderWidth = 5}):addTo(self)
	--iori:removeChildByTag(110, false)

	--if not self.iori then print('... not have jump iori ...') end
	self.iori = self.iori or {}
	self.body = self.body or {}
	local tmp
	local n = 1
	local dx = display.width/4
	local dy = display.height/4
	for r=1,4 do
		for c=1,4 do
			tmp = cc.Sprite:createWithSpriteFrame(frames[n])
			tmp:pos(dx/2+dx*(c-1),dy/2+dy*(r-1))
			display.newSolidCircle(8,{color = cc.c4f(0.0,0,1.0,0.8)}):addTo(tmp)
			self.iori[#self.iori+1] = tmp:addTo(self)
			n = n + 1
			if n == 15 then break end
		end
	end

	local spriteWidth = self.iori[1]:getContentSize().width
	local spriteHeight = self.iori[1]:getContentSize().height

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(88,64) ,cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-88)/2 - 28,(spriteHeight-64)/2 -4))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(148,42),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-148)/2 - 30,(spriteHeight-42)/2 - 20))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(148,42),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-148)/2 - 40,(spriteHeight-42)/2 - 20))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(118,46),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-118)/2 - 68,(spriteHeight-42)/2 - 24))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(88,60),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-88)/2 - 84,(spriteHeight-60)/2 - 14))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(88,60),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-88)/2 - 88,(spriteHeight-60)/2 - 14))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(76,56),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-76)/2 - 96,(spriteHeight-56)/2 - 14))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(68,58),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-68)/2 - 110,(spriteHeight-58)/2 - 14))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(68,58),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-68)/2 - 108,(spriteHeight-58)/2 - 14))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(76,56),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-76)/2 - 96,(spriteHeight-56)/2 - 14))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(88,60),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-88)/2 - 84,(spriteHeight-60)/2 - 14))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(88,60),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-88)/2 - 72,(spriteHeight-60)/2 - 14))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(118,46),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-118)/2 - 54,(spriteHeight-46)/2 - 20))

	self.body[#self.body+1] = cc.PhysicsBody:createBox(cc.size(88,64),cc.PHYSICSBODY_MATERIAL_DEFAULT , cc.p((spriteWidth-88)/2 -30,(spriteHeight-64)/2 - 4))

	for i=1,14 do
		self.iori[i]:setPhysicsBody(self.body[i])
		self.body[i]:setContactTestBitmask(3)
		self.body[i]:setTag(150+i)
	end

end

return iori_jump